<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<header id="wn__header" class="${('home' ==  page)?'':'oth-page'}  header__area header__absolute sticky__header">
  <div class="container-fluid">
    <div class="row">
      <div class="col-md-6 col-sm-6 col-6 col-lg-2">
        <div class="logo">
          <a href="/">
            <img src="/assets/images/logo/logo.png" alt="logo images">
          </a>
        </div>
      </div>
      <div class="col-lg-8 d-none d-lg-block">

        <!-- 菜单 -->
        <nav class="mainmenu__nav">
          <ul class="meninmenu d-flex justify-content-start">
            <li><a href="/">Home</a></li>
            <li><a href="/goods/list">图书列表</a></li>

            <%--<li class="drop"><a href="blog.html">Blog</a>
              <div class="megamenu dropdown">
                <ul class="item item01">
                  <li><a href="blog.html">Blog Page</a></li>
                </ul>
              </div>
            </li>--%>
          </ul>
        </nav>
      </div>
      <div class="col-md-6 col-sm-6 col-6 col-lg-2">
        <ul class="header__sidebar__right d-flex justify-content-end align-items-center">
          <c:if test="${empty loginUser}">
            <li><a href="/login">登录</a></li>
            <li style="margin-left: 8px"><a href="/register">注册</a></li>
          </c:if>

          <c:if test="${not empty loginUser}">
            <li class="wishlist" onclick="location.href='/orders/list'">
              <a href="/orders/list"></a>
            </li>
            <li class="shopcart" onclick="location.href='/ordersItem/list'">
              <a class="cartbox_active" href="/ordersItem/list">
                <span class="product_qun">${sessionOrderItemCount}</span>
              </a>
            </li>
            <li class="setting__bar__icon"><a class="setting__active" href="#"></a>
              <div class="searchbar__content setting__block">
                <div class="content-inner">
                  <div class="switcher-currency">
                    <c:if test="${loginUser.role == 'admin'}">
                      <strong class="label switcher-label">
                        <span><a href="/admin/index">后台管理</a></span>
                      </strong>
                    </c:if>

                    <div class="switcher-options">
                      <div class="switcher-currency-trigger">
                        <div class="setting__menu">
                          <span><a href="/info">个人信息</a></span>
                          <span><a href="/logout">退出登录</a></span>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </li>
          </c:if>


        </ul>
      </div>
    </div>
  </div>
</header>